﻿<%@ include file="../include/top.jsp"%>
<%@ include file="../include/errorArea.jsp"%>

<script type="text/javascript" src="${baseURL}/js/calendar.js">
</script>
<script type="text/javascript">
function preCreateComment(commentId){
	$.layer({
	    type: 2,
	    maxmin: true,
	    shadeClose: true,
	    title: '当前商品评论',
	    shade: [0.1,'#fff'],
	    offset: [($(window).height() / 10)+'px',''],
	    area: ['600px', '400px'],
	    iframe: {src: '${ctx}/productComment/preCommentReply/'+commentId}
	}); 
}

function clickSS(){
	document.getElementById("Image8").click(); 
}

$(document).ready(function(){
	var tablename=document.getElementById("listTable");
	var li=tablename.getElementsByTagName("tr");
	for (var i=0;i<=li.length;i++){
	if (i%2==0){
	li[i].style.backgroundColor="#f6f6f6";
	}else li[i].style.backgroundColor="#FFFFFF";
	}

});
</script>
<form action="" method="get" name="searchForm" id="searchForm">
<div class='adduser'>
	<div class='adduser-left'><div class='adduser-icon'></div><span>评论管理</span></div>
</div>
<div class='querycondition'>
	<div class='condtiontitle'><div class='searchcondition'></div>搜索条件：</div>
	<div class='condtion'>
		商品名称： <input name="productName" type="text" id="productName" value="${formdata.productName}" size="20" /> 
		评论时间： <input type="text" id="addTime" name="addTime" size="20" value="${formdata.addTime}" onclick="calendar.show(this);">
		
		<input name="image" style="display:none" type="image" id="Image8"
				onmouseover="MM_swapImage('Image8','','${baseURL}/images/button_ss_a.jpg',1)"
				onmouseout="MM_swapImgRestore()"
				src="${baseURL}/images/button_ss.jpg" /> &nbsp;&nbsp;&nbsp;&nbsp; 
		<input type='button' value='搜索'  class='button cyan medium' onclick="clickSS();">&nbsp;&nbsp;
		<input type='button' value='清空' class='button cyan medium' onclick="clearInput()">	
	</div>
</div>

</form>
<script>
function clearInput() {
	$("#productName").val("");
	$("#addTime").val("");
}

function selectAll(checkAllFlag) {
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		checkArray[i].checked = checkAllFlag;
	}
}
</script>
<c:if test="${empty obj.list}">
	<div align="center">
		<b>没有符合条件的记录。</b>
	</div>
</c:if>
<c:if test="${not empty obj.list}">
<div class='userlist-title'>
		<div class='userlist-title-left'><div class='userlist-title-icon'></div><span>评论列表：</span></div>
	</div>
	<div class='userlist'>
	<table width="94%" border="0" align="center" cellpadding="0"
		cellspacing="1" id="listOutTable">
		<tr>
			<td colspan="2" align="left" valign="middle" class="text_gray2">
			<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#96bee2" id="listTable">
					<tr>
						<td height="13" valign="top" bgcolor="#FFFFFF"><label><input
								type="checkbox" onclick="selectAll(this.checked);">全选</label>

							<table width="100%" border="0" cellpadding="0" cellspacing="1"
								bgcolor="#FFFFFF" id="listTable" style="word-break: break-all;">

								<c:forEach var="oneRow" items="${obj.list}">
									<tr class='userlist-tr-title'>
										<td class='userlist-td operation' height="25" width="5%" align="center"><input
											name="chk" type="checkbox" id="chk" value="${oneRow.id}" /></td>

										<td class='userlist-td operation'>评价商品：<a
											href="${ctx}/sell/show?id=${oneRow.productId}"
											target="_blank"><b>${oneRow.productName}</b></a></td>
										<td class='userlist-td operation' width="20%">评价时间：<fmt:formatDate
												value="${oneRow.createTime}" pattern="yyyy/MM/dd HH:mm:ss" /></td>
										<td class='userlist-td operation' width="10%">评分：${oneRow.score}</td>
										<td class='userlist-td operation' width="10%"><a href="#"
											onclick="preCreateComment(${oneRow.id});">[回复]</a></td>
									</tr>
									<tr class='userlist-tr-title'>
										<td class='userlist-td operation' colspan="5">
											评价：<c:out value="${oneRow.content}" default="无" escapeXml="true" /><br /><br />
											<c:if test="${oneRow.commentRreply != null}">
											回复：<c:out value="${oneRow.commentRreply}" default="无" escapeXml="true" /><br /><br />
											</c:if>
										</td>
									</tr>
								</c:forEach>
							</table></td>
					</tr>
				</table></td>
		</tr>
		<tr>
			<td height="25" colspan="2"><%@ include
					file="../include/listpage.jsp"%></td>
		</tr>
	</table>
	</div>
	<script src="${ctx}/js/listComment.js"></script>
</c:if>

<%@ include file="../include/bottom.jsp"%>